package cn.kgc.tangcco.controller;

import cn.kgc.tangcco.service.IdiomService;
import org.springframework.web.bind.annotation.*;

/**
 * @author 李昊哲
 * @Description
 * @create 2021/1/27 11:59
 */
@RestController
@RequestMapping(value = "/idiom")
public class IdiomController {
    private final IdiomService idiomService;

    public IdiomController(IdiomService idiomService) {
        this.idiomService = idiomService;
    }

    @GetMapping(value = "/finAllByDiscoveryClient")
    public String finAllByDiscoveryClient(
            @RequestParam(name = "page",defaultValue = "1",required = true) Integer page,
            @RequestParam(name = "limit",defaultValue = "2",required = true) Integer limit){
        return  idiomService.finAllByDiscoveryClient(page,limit);
    }

    @GetMapping(value = "/finAllByLoadBalancerClient")
    public String finAllByLoadBalancerClient(
            @RequestParam(name = "page",defaultValue = "1",required = true) Integer page,
            @RequestParam(name = "limit",defaultValue = "2",required = true) Integer limit){
        return  idiomService.finAllByDiscoveryClient(page,limit);
    }

    @GetMapping(value = "/finAllByLoadBalancerClientAnnotation")
    public String finAllByLoadBalancerClientAnnotation(
            @RequestParam(name = "page",defaultValue = "1",required = true) Integer page,
            @RequestParam(name = "limit",defaultValue = "2",required = true) Integer limit){
        return  idiomService.finAllByLoadBalancerClientAnnotation(page,limit);
    }


}
